package partation;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

public class MyPartitioners extends Partitioner<Text, Text> {

	@Override
	public int getPartition(Text key, Text value, int numPartition) {
		final String key2 = key.toString();
		if ("男".equals(key2)) {
			return 0 % numPartition;
		} else if ("女".equals(key2)) {
			return 1 % numPartition;
		} else {
			return 2 % numPartition;
		}
	}

}
